package com.zenghus.template;


import java.util.Map;

public abstract class Login {

    public String username;
    public String password;
    public boolean isLoginSuccess;
    public Map<String,Object> userData;

    Login(String username,String password){
        this.username=username;
        this.password=password;
    }

    protected abstract boolean validateUser();

    protected abstract Map<String,Object> getUserData();

    public final void userLogin(){
        isLoginSuccess=this.validateUser();
        //验证用户名密码是否正确
        if(isLoginSuccess) {
            //如果正确获取用户信息
            this.userData = this.getUserData();
        }
    }

}
